odoo.define('watermeters.tree_view_button', function (require) {
    "use strict";

    var show_button_model = ['watermeters.watermeter'];//哪些模型显示按钮
    var core = require('web.core');
    var ListView = require('web.ListView');
    var QWeb = core.qweb;
    ListView.include({
        render_buttons: function () {
            var self = this;
            this._super.apply(this, arguments);
            var tree_model = this.dataset.model;
            for(var i = 0; i < show_button_model.length; i++) {
                if(tree_model == show_button_model[i]) {
                    var btn = $("<button type='button' class='btn btn-primary btn-sm abc'>初始化</button>")
                        .click(this.proxy('tree_view_action'));
                    this.$buttons.append(btn);
                }
            }
        },
        tree_view_action: function() {
            this.do_action({

            });
            return { 'type': 'ir.actions.client','tag': 'reload', };
        }
    });
});